package com.example.administrator.yuejian35.Me;

import com.example.administrator.yuejian35.Config;

import okhttp3.MultipartBody;
import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by JUSTIN on 2017/9/26.
 */

public class MeModel {
    private Retrofit retrofit;
    private MeServer service;

    public MeModel(){
        retrofit =
                new Retrofit.Builder()
                        .baseUrl(Config.BASE_URL)
                        .addConverterFactory(GsonConverterFactory.create())
                        .build();
    }

    private void service(){
        service=retrofit.create(MeServer.class);
    }


    public Call userinfo(String uid)//用户信息
    {
        service();
        return  service.userinfo(uid);
    }

    public Call editusers(String uid, String uname, String intro, String sex,
                          String tel, String address, MultipartBody.Part file)//用户信息,有文件
    {
        service();
        return  service.editusers(uid,uname,intro,sex,tel, address,file);
    }

    public Call edituser(String uid, String uname, String intro, String sex,
                         String tel, String address)//用户信息，无文件
    {
        service();
        return  service.edituser(uid,uname,intro,sex,tel, address);
    }






}
